<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人主页 - Demo</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background-image: url("/static/img/6.png");
            background: url("/static/img/6.png");
            background-attachment: fixed;
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            background-color: #e9e9e9; /* 备用背景色，与登录页面一致 */
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .header {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

        .logo {
            color: white;
            font-size: 1.5rem;
            font-weight: bold;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .welcome-text {
            color: white;
            font-size: 1rem;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 0.5rem 1rem;
            border-radius: 25px;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .logout-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }

        .main-content {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 2rem;
        }

        .dashboard-container {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            padding: 3rem;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-width: 800px;
            width: 100%;
            text-align: center;
        }

        .dashboard-title {
            color: #333;
            font-size: 2.5rem;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .dashboard-subtitle {
            color: #666;
            font-size: 1.2rem;
            margin-bottom: 2rem;
        }

        .user-details {
            background: #f8f9fa;
            border-radius: 15px;
            padding: 2rem;
            margin: 2rem 0;
            text-align: left;
        }

        .user-details h3 {
            color: #333;
            margin-bottom: 1rem;
            font-size: 1.3rem;
        }

        .detail-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.8rem 0;
            border-bottom: 1px solid #e9ecef;
        }

        .detail-item:last-child {
            border-bottom: none;
        }

        .detail-label {
            font-weight: bold;
            color: #555;
        }

        .detail-value {
            color: #333;
        }

        .actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-top: 2rem;
        }

        .action-btn {
            background: white;
            color: #333;
            border: 2px solid #ddd;
            padding: 0.8rem 2rem;
            border-radius: 25px;
            text-decoration: none;
            font-size: 1rem;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            border-color: #bbb;
        }

        .action-btn.secondary {
            background: white;
            color: #333;
            border: 2px solid #ddd;
        }

        .action-btn.secondary:hover {
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            border-color: #bbb;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 2rem 0;
        }

        .stat-card {
            background: white;
            color: #333;
            padding: 1.5rem;
            border-radius: 15px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            border: 2px solid #ddd;
        }

        .stat-number {
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }

        .stat-label {
            font-size: 0.9rem;
            opacity: 0.9;
        }
    </style>
</head>
<body>
    <header class="header">
        <div class="logo">Course Schedule System</div>
        <div class="user-info">
            <span class="welcome-text">欢迎, <span th:text="${username}">用户</span>!</span>
            <form action="/logout" method="post" style="display: inline;">
                <input type="hidden" name="_csrf" th:value="${_csrf.token}" />
                <button type="submit" class="logout-btn">退出登录</button>
            </form>
        </div>
    </header>

    <main class="main-content">
        <div class="dashboard-container">
            <h1 class="dashboard-title">个人主页</h1>
            <p class="dashboard-subtitle">欢迎来到您的个人控制台</p>

            <div class="stats">
                <div class="stat-card">
                    <div class="stat-number" th:text="${#temporals.format(#temporals.createNow(), 'yyyy年MM月dd日')}">2025年07月03日</div>
                    <div class="stat-label" th:text="${#temporals.format(#temporals.createNow(), 'EEEE')}">星期三</div>
                </div>
            </div>

            <div class="user-details">
                <h3>账户信息</h3>
                <div class="detail-item">
                    <span class="detail-label">用户名:</span>
                    <span class="detail-value" th:text="${username}">username</span>
                </div>
                <div class="detail-item">
                    <span class="detail-label">邮箱:</span>
                    <span class="detail-value" th:text="${email}">email@example.com</span>
                </div>
                <div class="detail-item">
                    <span class="detail-label">注册时间:</span>
                    <span class="detail-value" th:text="${#temporals.format(createdAt, 'yyyy年MM月dd日 EEEE HH:mm')}">2025年07月03日 星期三 22:18</span>
                </div>
                <div class="detail-item">
                    <span class="detail-label">账户状态:</span>
                    <span class="detail-value" th:text="${enabled ? '已激活' : '未激活'}">已激活</span>
                </div>
            </div>

            <div class="actions">
                <a href="../courses_view(1).html" class="action-btn">我的课程</a>
            </div>
        </div>
    </main>
</body>
</html>
